const menu_data = [
  {
    "children": [
      {
        "index": "lineName",
        "label": "产线:lineNamedddddddddddd",
        "showHighlight": false
      },
      {
        "index": "line1",
        "label": "产线:line1",
        "showHighlight": true
      },
      {
        "index": "line2",
        "label": "产线:line2",
        "showHighlight": false
      },
      {
        "index": "line5",
        "label": "产线:line5",
        "showHighlight": false
      },
      {
        "index": "9655",
        "label": "产线:9655",
        "showHighlight": true
      },
      {
        "index": "1Line1",
        "label": "产线:1Line1",
        "showHighlight": true
      },
      {
        "index": "2Line",
        "label": "产线:2Line",
        "showHighlight": true
      },
      {
        "index": "line88",
        "label": "产线:line88",
        "showHighlight": false
      }
    ],
    "index": "scan",
    "label": "扫描记录"
  },
  {
    "children": [
      {
        "index": "lineName",
        "label": "产线:lineName",
        "showHighlight": false
      },
      {
        "index": "line1",
        "label": "产线:line1",
        "showHighlight": false
      },
      {
        "index": "line2",
        "label": "产线:line2",
        "showHighlight": false
      },
      {
        "index": "line5",
        "label": "产线:line5",
        "showHighlight": false
      },
      {
        "index": "9655",
        "label": "产线:9655",
        "showHighlight": false
      },
      {
        "index": "1Line1",
        "label": "产线:1Line1",
        "showHighlight": false
      },
      {
        "index": "2Line",
        "label": "产线:2Line",
        "showHighlight": false
      },
      {
        "index": "line88",
        "label": "产线:line88",
        "showHighlight": false
      }
    ],
    "index": "program",
    "label": "程序管理"
  },
  {
    "children": [
      {
        "index": "lineName",
        "label": "产线:lineName",
        "showHighlight": false
      },
      {
        "index": "line1",
        "label": "产线:line1",
        "showHighlight": false
      },
      {
        "index": "line2",
        "label": "产线:line2",
        "showHighlight": false
      },
      {
        "index": "line5",
        "label": "产线:line5",
        "showHighlight": false
      },
      {
        "index": "9655",
        "label": "产线:9655",
        "showHighlight": false
      },
      {
        "index": "1Line1",
        "label": "产线:1Line1",
        "showHighlight": false
      },
      {
        "index": "2Line",
        "label": "产线:2Line",
        "showHighlight": false
      },
      {
        "index": "line88",
        "label": "产线:line88",
        "showHighlight": false
      }
    ],
    "index": "bom",
    "label": "BOM管理"
  },
  {
    "children": [],
    "index": "spec",
    "label": "规格库"
  },
  {
    "children": [],
    "index": "usermanage",
    "label": "用户管理"
  }
]

//这里主要是设置路由
function generateMenu(internetMenu) {
  // console.log('-------------------------00')
  // console.log(internetMenu)
  for (var i = 0; i < internetMenu.length; i++) {
    var menu = internetMenu[i]
    if (menu.index === "scan") {
      for (var j = 0; j < menu.children.length; j++) {
        menu.children[j].index = '/wrapper/programlist?chanxian=' + menu.children[j].index
      }
    }
    else if (menu.index === "program") {
      for (var j = 0; j < menu.children.length; j++) {
        menu.children[j].index = '/wrapper/programfilelist?chanxian=' + menu.children[j].index
      }
    }

    else if (menu.index === "spec") {
      menu.index = "/wrapper/clientlist"
    }

    else if (menu.index === "bom") {
      for (var j = 0; j < menu.children.length; j++) {
        menu.children[j].index = '/wrapper/bomlist?chanxian=' + menu.children[j].index
      }
    }
    else if (menu.index === 'usermanage') {
      // internetMenu.splice(i, 1)//权哥 要求 暂时 隐藏
    }
    else if(menu.index === 'board'){
      for (var j = 0; j < menu.children.length; j++) {
        if(j===0){
          menu.children[j].index = '/wrapper/lineBoard'
          menu.children[j].showTv=true
        }else{
          menu.children[j].index = '/wrapper/lineStatus?chanxian=' + menu.children[j].index
          menu.children[j].showTv=true
        }

      }
    }else if(menu.index === 'remainQuantity'){
      for (var j = 0; j < menu.children.length; j++) {
        for (var j = 0; j < menu.children.length; j++) {
          menu.children[j].index = '/wrapper/programSurplusList?chanxian=' + menu.children[j].index
        }

      }
    }else if (menu.index === "counterConfig") {
      menu.index = "/wrapper/counterConfig"
    }else if(menu.index==='user'){
      menu.index = "/wrapper/user"
    }

  }
  return internetMenu
}

export default {
  menu_data,
  generateMenu
}
